/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.worlds.object;

import java.awt.Color;
import net.worlds.WorldsException;
import net.worlds.PropChangeHandler;
import net.worlds.ui.edge.EFrame;
import net.worlds.ui.edge.EStickyFrame;


public class UIStickyFrame extends UIComponent{
    public UIStickyFrame() throws WorldsException
    {
        super("UIStickyFrame");
        component = new EStickyFrame(null, 0, 0, 0, 0, 0, 0);
        addPropChangeHandler("MarginLeft", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EStickyFrame)component).leftMargin = (Integer) value;
            }
        });
        addPropChangeHandler("MarginRight", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EStickyFrame)component).rightMargin = (Integer) value;
            }
        });
        addPropChangeHandler("MarginTop", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EStickyFrame)component).topMargin = (Integer) value;
            }
        });
        addPropChangeHandler("MarginBottom", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EStickyFrame)component).bottomMargin = (Integer) value;
            }
        });
        addPropChangeHandler("BackgroundColor", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EFrame)component).setBackgroundColor(((Color)value));
            }
        });
        addPropChangeHandler("BorderColor", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EFrame)component).setBorderColor(((Color)value));
            }
        });
        addPropChangeHandler("Undecorated", new PropChangeHandler()
        {
            @Override
            public void handle(Object oldValue, Object value) throws WorldsException {
                ((EFrame)component).setUndecorated((Boolean)value);
            }
        });
    }
}
